package com.colin.service;

import com.colin.dao.UsersMapper;
import com.colin.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class UsersServiceImpl implements UsersService{
    @Autowired
    private UsersMapper usersMapper;

    public void setUsersMapper(UsersMapper usersMapper) {
        this.usersMapper = usersMapper;
    }

    @Override
    public Users queryByUser(String user) {
        return usersMapper.queryByUser(user);
    }

    @Override
    public int addUser(Users users) {
        return usersMapper.addUser(users);
    }

    @Override
    public Users queryUserInfo(int uid) {
        return usersMapper.queryUserInfo(uid);
    }

    @Override
    public int updateUser(Users users) {
        return usersMapper.updateUser(users);
    }

    @Override
    public int updateUserPass(Users users) {
        return usersMapper.updateUserPass(users);
    }

    @Override
    public int updateUserAvatar(Users users) {
        return usersMapper.updateUserAvatar(users);
    }

    // 获取所有的技能
    public ArrayList<Object> getSkills(){
        ArrayList<Object> skills = new ArrayList<>();
        skills.add("Java");
        skills.add("PHP");
        skills.add("JavaScript");
        skills.add("Python");
        skills.add("Go");
        skills.add("Linux");
        skills.add("Mysql");
        skills.add("SpringMVC");
        return skills;
    }

    // 获取性别
    public ArrayList<Object> getSex(){
        ArrayList<Object> sex = new ArrayList<>();
        sex.add("男");
        sex.add("女");
        return sex;
    }
}
